<?php
include("../../inc/conn.inc");
include("../islogin.php");
include("../../job/inc/fun.php");
$url="inbox.php";
$thepage=$_GET['page']?$_GET['page']:1;
$maxpage=10;
if($_GET['del_act']){
@mysql_query("update job_mailbox set to_del='0' where id='".$_GET['del_id']."' and to_id='".$_COOKIE['user_id']."'");

echo("<script>location='".$_SERVER['HTTP_REFERER']."';</script>"); 
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>会员中心-三帝贸易网</title>
<link href="../css/css.css" rel="stylesheet" type="text/css" />
</head>
<script type="text/javascript" src="../js/left.js" charset="gb2312"></script>
<body>
<div id="mian">
<?php include("../inc/top.php");?>
<div class="top1"><span>您当前位置：<a href="../index.php" class="dh">会员助手</a> &gt;&gt; 招聘管理 &gt;&gt; 收件夹 </span></div>
<div class="left">
<?php include("../inc/left.php");?>
</div>
<div class="right">
<TABLE cellSpacing="0" cellPadding="0" width="100%" border="0">
   <TR>
     <TD height="40" bgcolor="#EFF6FF" style="font-size:18px;font-weight:bold;padding-left:8px;">收件夹</TD>
   </TR>
</TABLE>
<br>
<table width="100%" cellspacing="1" bgcolor="#C1DCF5">
        <tr>
          <td width="7%" height="30" align="center" bgcolor="#EFF6FF">编号</td>
          <td width="42%" align="center" bgcolor="#EFF6FF">信息标题</td>
          <td width="16%" align="center" bgcolor="#EFF6FF">发信人</td>
          <td width="14%" align="center" bgcolor="#EFF6FF">时间</td>
          <td width="10%" align="center" bgcolor="#EFF6FF">阅读</td>
          <td width="11%" align="center" bgcolor="#EFF6FF">操作</td>
        </tr>
<?php
$sql="select id,box_title,from_id,box_addtime,is_read from job_mailbox  where to_id='".$_COOKIE['user_id']."' and  to_del=1 order by is_read desc,id desc limit ".($thepage-1)*$maxpage.",$maxpage";
$rs=mysql_query($sql);
$i=1;
while($row=mysql_fetch_array($rs)){
?>
        <tr style="line-height:22px;">
          <td height="22" align="center" bgcolor="#FFFFFF"><?=$i?></td>
          <td align="center" bgcolor="#FFFFFF"><?=$row[box_title]?></td>
          <td align="center" bgcolor="#FFFFFF"><a href="perinfo.php?id=<?=$row[from_id]?>" target="_blank" title="查看简历">
		  <?php
		    $rs2=@mysql_query("select p_name from job_per where id='$row[from_id]'");
			$row2=@mysql_fetch_array($rs2);
			echo $row2[p_name];
		  ?></a>
		  </td>
          <td align="center" bgcolor="#FFFFFF"><?=date("Y-m-d",strtotime($row[box_addtime]))?></td>
          <td align="center" bgcolor="#FFFFFF"><?php if($row[is_read]==1){echo "是";}else{echo "<font color='red'>否</font>";}?></td>
          <td align="center" bgcolor="#FFFFFF"><a href="<?=$url?>?del_act=ok&del_id=<?=$row['id']?>" style="color:#0000FF;">删除</a>&nbsp;&nbsp;&nbsp;<a href="inboxinfo.php?id=<?=$row['id']?>" target="_blank" style="color:#0000FF;">查看</a></td>
        </tr>
<?php
$i++;
}?>
<?php
$rs3=@mysql_query("select count(id) from job_mailbox  where to_id='".$_COOKIE['user_id']."' and  to_del=1");
$totalrecord=@mysql_result($rs3,0);
@mysql_free_result($rs3);
$totalpage=ceil($totalrecord/$maxpage);
if($totalpage>0){
?>
        <tr>
          <td colspan="6" align="center" bgcolor="#FFFFFF" height="18"><script language="javascript">
<!--
function showPageLink(sUrl,iPage,iCount){
	var i;
	i=Math.max(1,iPage-1);
	document.write("<a href=\"" + sUrl + "1\">«</a> ");
	document.write("<a href=\"" + sUrl + i + "\">上一页</a> ");
	for(i=Math.max(1,iPage-8);i<iPage;i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	document.write("<font color='#ff3333'><b>" + iPage + "</b></font> ");
	for(i=iPage+1;i<=Math.min(iCount,iPage+8);i++){
		document.write("<a href=\""+sUrl + i + "\"><b>" + i + "</b></a> ");
	}
	i=Math.min(iCount,iPage+1);
	if(iCount>iPage+8) document.write("<span style='font-size:8px'>···</span> ");
	document.write("<a href=\"" + sUrl + i + "\">下一页</a> ");
	document.write("<a href=\"" + sUrl + iCount + "\">»</a> ");
}
showPageLink("<?=$url?>?page=",<?=$thepage?>,<?=$totalpage?>);
//-->
</script></td>
        </tr><?php }?>
    </table>
</div>
<div class="onl"></div>
<?php include("../inc/foot.php");?>
</div>
</body>
</html>
